package com.gxkj.projects.myshopx.services;

import com.gxkj.common.exceptions.ValidateException;
import com.gxkj.common.utils.ListPager;
import com.gxkj.projects.myshopx.dtos.GalleryDto;
import com.gxkj.projects.myshopx.entitys.*;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;
import java.util.List;

/**
 * Created by dell on 2016/3/5.
 */
public interface GoodsService {

    public void doAddGoods(User user , Goods goods,MultipartFile goodImg, List<GalleryDto> galleryDtoList, List<GoodsAttr> goodsAttrList,List<LinkGoods> linkGoodses) throws ValidateException, IOException;

    /**
     *
     * @param user
     * @param entity
     * @param goodsImg                  商品图片
     * @param galleryDtoList            商品图集列表
     * @param goodsAttrList             商品属性列表
     * @param delGalleryList            需要删除的商品图集列表
     * @param delGoodsAttrIdList        需要删除的商品属性值列表
     * @throws ValidateException
     */
    public void doUpdateGoods(User user, Goods entity, MultipartFile goodsImg, List<GalleryDto> galleryDtoList, List<GoodsAttr> goodsAttrList,List<String> delGalleryList, List<String> delGoodsAttrIdList) throws ValidateException;

    public void doDeleteGoods(User user, String goodsId);

    public ListPager<Goods> doPageHQL(int pagenNo, int pageSize,Goods entity);

    public Goods getById(String id);

    public List<GoodsGallery> selectGoodsGalleryByGoodsId(String goodsId);

    public List<GoodsAttr> selectGoodsAttrByGoodsId(String goodsId);


    public void updateGoodsGallery(User user,String galleryId, String goods_imgDesc);

    public void dodelGoodsGallery(User user,String galleryId);
}
